
<!-- BEGIN:main -->

<script language="javascript" type="text/javascript">
    function submitLoaiHoaHong(action)
    {

    if(action=='cancel'){
        window.history.back(2);
    }else{
         var LHH_TIEN_MAT = $('#LHH_TIEN_MAT');
         var LHH_PHAN_TRAM = $('#LHH_PHAN_TRAM');
         var LHH_ID = $('#LHH_ID');
         var LHH_TEN_LOAI = $('#LHH_TEN_LOAI');
      
          
         var arrayInput = new Array(LHH_ID,LHH_TEN_LOAI);
        var hasError = validateEmptyValue(arrayInput);
        if (hasError) {
            alert('Vui lòng điền đầy đủ dữ liệu');
        }else if(LHH_TIEN_MAT.val()=='' && LHH_PHAN_TRAM.val()==''){
			 alert('Vui lòng nhập vào tiền mặt hoặc phần trăm');
		 }  else {
        var dataString = 'hdAction=' + action;
        dataString += '&LHH_ID=' + LHH_ID.val();
        dataString += '&LHH_TEN_LOAI=' + LHH_TEN_LOAI.val();   
         dataString += '&LHH_TIEN_MAT=' + LHH_TIEN_MAT.val();    
       dataString += '&LHH_PHAN_TRAM=' + LHH_PHAN_TRAM.val(); 
        $.ajax({
            url: '.?com=com_dm_loaihoahong&task=edit',
            type: "POST",
            data: dataString,
            cache: false,
            success: function(data) {
                if (data.trim() == 'OK') {
                    alert('Cập nhật thành công');
                    window.location.href='.?com=com_dm_loaihoahong';
                    
                }
            }
        });
        
            }
    }
       


    }
</script> 


<!--biến giá trị hành động-->

<!-- BEGIN:loaihoahong -->
<div data-role="content">
   
        <h2><div class="header icon-48-article-edit">
                        Loại hoa hồng: <small><small>[ Sửa ]</small></small>
                    </div></h2>

        <form method="post" name="phpForm" id="phpForm" action="" class="ui-body ui-body-c ui-corner-all">
            
            
            <input type="hidden" name="LHH_ID" id="LHH_ID" value="{LHH_ID}"/>
            <input type="hidden" name="hdAction" id="hdAction" />
            <div data-role="fieldcontain" >
                <label for="name-c" style=" width:150px;display: inline-block; ">Loại hoa hồng:</label>
                <input type="text" name="LHH_TEN_LOAI" id="LHH_TEN_LOAI" value="{LHH_TEN_LOAI}"  />
            </div>

          <div data-role="fieldcontain" >
                <label for="name-c" style=" width:150px;display: inline-block; ">Tiền mặt(VNĐ):</label>
                <input type="text" name="LHH_TIEN_MAT" id="LHH_TIEN_MAT" value="{LHH_TIEN_MAT}"  />
            </div> 
	        <div data-role="fieldcontain" >
                <label for="name-c" style=" width:150px;display: inline-block; ">Phần trăm(%):</label>
                <input type="text" name="LHH_PHAN_TRAM" id="LHH_PHAN_TRAM" value="{LHH_PHAN_TRAM}"  />
            </div> 

      
            <div class="ui-body ui-body-b">
                <fieldset class="ui-grid-a">
                    <div class="ui-block-a">
                        <a href="javascript:void()" onclick="submitLoaiHoaHong('cancel');" data-role="button"  data-theme="c">
                            Cancel</a>
                    </div>
                    <div class="ui-block-b">
                        <a href="javascript:void()" onclick="submitLoaiHoaHong('edit');" data-role="button"  data-theme="b">
                            Lưu</a>
                    </div>
                    
                </fieldset>
            </div>
        </form>

  




</div>
  <!-- END:loaihoahong -->
<div data-role="footer" data-theme="b" data-position="fixed">
    <div class="ui-bar">
        <a href="./?com=com_dm_loaihoahong" data-role="button" data-icon="refresh" data-theme="b" style="float:left;">Trở lại</a>        
    </div>
</div>   


<!-- END:main -->
